package cs236369.webserver.classes;

import java.io.FileInputStream;
import java.util.UUID;

import javassist.NotFoundException;

import javax.xml.xpath.XPathExpressionException;

import org.junit.Before;
import org.junit.Test;

import cs236369.webserver.Parser;


public class CreateClassTest {
	
	Parser testingParser;
	
	@Before
	public void init() throws Exception {
		
		// creating the InputStream
		FileInputStream fip = new FileInputStream("configClassTst.xml");
		testingParser = new Parser(fip);
	}
	
	@Test
	public void testCreateClass() throws Exception {
		
		String pathname = testingParser.getCompilePath("cs236369.webserver.TSPEngine");
		String className = UUID.randomUUID().toString();
		CreateClass testing  = new CreateClass(pathname, className);
		
		testing.addCommandToMethod("System.out.println(\"MKay?\");");
		testing.addMethod();
		testing.activateMehod(null,null,null);
		
	}
}
